package sort;

public class TestReview {
    // int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
    // 选择排序测试
    private static void test1() {
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.selectSort(arr);
        SortReview.show(arr);
    }

    // 堆排序测试
    private static void test2() {
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.heapSort(arr);
        SortReview.show(arr);
    }

    // 冒泡排序测试
    private static void test3() {
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.bubbleSort(arr);
        SortReview.show(arr);
    }

    // 插入排序测试
    private static void test4() {
        int[] arr = {110, 100, 0};
        SortReview.insertSort(arr);
        SortReview.show(arr);
    }

    // 快速排序测试
    private static void test5() {
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.quickSort(arr);
        SortReview.show(arr);
    }

    // 希尔排序测试
    private static void test6() {
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.shellSort(arr);
        SortReview.show(arr);
    }

    // 归并排序测试
    private static void test7() {
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.mergeSort(arr);
        SortReview.show(arr);
    }
    public static void main(String[] args) {
        System.out.println("排序前：");
        int[] arr = {6, 5, 7, 3, 2, 1, 2, 7, 9, 9, 3, 4, 5, 10, 8};
        SortReview.show(arr);
        System.out.println("排序后：");
//        test1();
//        test2();
//        test3();
//        test4();
        test5();
//        test6();
//        test7();
    }
}
